package com.ruoyi.ctcx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ctcx.domain.TbInsuranceContract;
import com.ruoyi.ctcx.domain.ro.InsuranceParam;
import com.ruoyi.ctcx.domain.ro.InsuranceQueryParam;
import com.ruoyi.ctcx.domain.vo.TbInsuranceContractDetailVo;
import com.ruoyi.ctcx.domain.vo.TbInsuranceContractQueryVo;
import com.ruoyi.ctcx.domain.vo.TbInsuranceDetailVo;
import com.ruoyi.ctcx.mapper.TbInsuranceContractMapper;
import com.ruoyi.ctcx.service.ITbInsuranceContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 保险合同主Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-19
 */
@Service
public class TbInsuranceContractServiceImpl implements ITbInsuranceContractService
{
    @Autowired
    private TbInsuranceContractMapper tbInsuranceContractMapper;

    /**
     * 查询保险合同主
     * 
     * @param id 保险合同主主键
     * @return 保险合同主
     */
    @Override
    public TbInsuranceContract selectTbInsuranceContractById(String id)
    {
        return tbInsuranceContractMapper.selectTbInsuranceContractById(id);
    }

    /**
     * 查询保险合同主列表
     * 
     * @param tbInsuranceContract 保险合同主
     * @return 保险合同主
     */
    @Override
    public List<TbInsuranceContract> selectTbInsuranceContractList(TbInsuranceContract tbInsuranceContract)
    {
        return tbInsuranceContractMapper.selectTbInsuranceContractList(tbInsuranceContract);
    }

    /**
     * 新增保险合同主
     * 
     * @param tbInsuranceContract 保险合同主
     * @return 结果
     */
    @Override
    public int insertTbInsuranceContract(TbInsuranceContract tbInsuranceContract)
    {
        tbInsuranceContract.setCreateTime(DateUtils.getNowDate());
        return tbInsuranceContractMapper.insertTbInsuranceContract(tbInsuranceContract);
    }

    /**
     * 修改保险合同主
     * 
     * @param tbInsuranceContract 保险合同主
     * @return 结果
     */
    @Override
    public int updateTbInsuranceContract(TbInsuranceContract tbInsuranceContract)
    {
        tbInsuranceContract.setUpdateTime(DateUtils.getNowDate());
        return tbInsuranceContractMapper.updateTbInsuranceContract(tbInsuranceContract);
    }

    /**
     * 批量删除保险合同主
     * 
     * @param ids 需要删除的保险合同主主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceContractByIds(String[] ids)
    {
        return tbInsuranceContractMapper.deleteTbInsuranceContractByIds(ids);
    }

    /**
     * 删除保险合同主信息
     * 
     * @param id 保险合同主主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceContractById(String id)
    {
        return tbInsuranceContractMapper.deleteTbInsuranceContractById(id);
    }

    @Override
    public List<TbInsuranceContractQueryVo> getContractList(InsuranceParam insuranceParam) {
        return tbInsuranceContractMapper.getContractList(insuranceParam);
    }

    @Override
    public TbInsuranceContractDetailVo selectTbInsuranceContractByInsureId(InsuranceQueryParam insuranceQueryParam) {
        return tbInsuranceContractMapper.selectTbInsuranceContractByInsureId(insuranceQueryParam);
    }
}
